package com.zues.samples.dao;

import java.util.Collection;
import java.util.List;

import com.zues.samples.model.PagerModel;
import com.zues.samples.model.User;
import com.zues.samples.service.modelVO.UserVO;

public interface UserDAO {
	/**
	 * 查找全部用户
	 * 
	 * @return
	 * @throws Exception
	 */
	public List<User> findAllUsers() throws Exception;

	/**
	 * 创建一个用户
	 * 
	 * @param user
	 * @throws Exception
	 */
	public void createUser(User user) throws Exception;

	/**
	 * 通过UserId获取User
	 * 
	 * @param id
	 * @return
	 */
	public User getUserById(String UserId) throws Exception;

	//public void updateUserLoginFailCount(User user) throws Exception;

	/**
	 * 编辑用户
	 * 
	 * @param user
	 * @throws Exception
	 */
	public void editUser(User user) throws Exception;

	/**
	 * 删除用户
	 * 
	 * @param id
	 * @throws Exception
	 */
	public void deleteUser(int UserId) throws Exception;

	/**
	 * 批量存
	 * 
	 * @param entities
	 * @throws Exception
	 */
	public void save(Collection<User> entities) throws Exception;

	/**
	 * 翻页查找数据
	 * 
	 * @return
	 */
	public PagerModel<UserVO> findAllByPage();
	
	/**
	 * 通过Subjectid
	 * 找User
	 * @param subjectId
	 * @return
	 */
	public List<String> getAllUserBySubject(Integer subjectId);
	
	public void updateUserLoginFailCount(User user) throws Exception;
	
	public void updateUserLastLockTime(User user) throws Exception;
}
